{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sisl\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create the input required for a full TranSiesta calculation. Here you should create your first system with these settings:\n",
    "\n",
    "- A pristine bulk Carbon-chain system.\n",
    "- The Carbon-chain should have a bond-length of $1.5\\,\\mathrm{Ang}$ and lots of vacuum in the transverse directions (to make it a chain)\n",
    "- You should decide in which direction the semi-infinite directions are.\n",
    "\n",
    "Please use the script `tselecs.sh` to create the relevant input for TranSiesta.  \n",
    "Below you will find a skeleton code that only requires editing from your side."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "C = sisl.Atom(6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Create the electrode.\n",
    "  Supply the coordinates and the supercell.\n",
    "  Note that you _have_ to decide the semi-infinite\n",
    "  direction by ensuring the electrode to \n",
    "  be periodic in the semi-infinite direction. You should also ensure *nearest neighbour electrode couplings* **only**!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "elec = sisl.Geometry(<fill-in coordinates>,\n",
    "                     atoms=C,\n",
    "                     lattice=<unit-cell size>)\n",
    "elec.write('ELEC.fdf')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Create the device.\n",
    "  The basic unit-cell for a fully periodic device\n",
    "  system is 3-times the electrode size.  \n",
    "  *HINT*: If you are not fully sure why this is, please see [TS 1](../TS_01/run.ipynb)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "device = elec.tile(3, axis=<semi-infinite direction>)\n",
    "device.write('DEVICE.fdf')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exercises\n",
    "\n",
    "- Perform the TranSiesta calculation\n",
    "- Create inputs for TBtrans to calculate the Green function density of states, and specify the energy range from $-10$ eV to $10$ eV.\n",
    "- Plot the transmission and DOS"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
